package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.springframework.beans.BeanUtils;

import com.qdlc.p2p.common.constant.Global;

/**
 * user_login 实体类
 *
 * @author liya
 * @version 1.1.0.0
 */
@Deprecated
@Entity
@Table(name = Global.DB_PREFIX + "user_login")
public class UserLogin {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 用户ID */
    @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinColumn(name = "user_id")
    private User user;

    /** 用户密码 */
    private String pwd;

    /** 交易密码 */
    private String payPwd;

    /** 添加时间 */
    private Date addTime;

    /** 删除状态 */
    private int isDelete;

    private UserLogin() {
    }

    private UserLogin(User user) {
        this.user = user;
        BeanUtils.copyProperties(user, this);
    }

    /**
     * 获取主键
     *
     * @return 主键
     */
    public long getId() {
        return id;
    }

    /**
     * 设置主键
     *
     * @param id 要设置的主键
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * 获取用户ID
     *
     * @return 用户ID
     */
    public User getUser() {
        return user;
    }

    /**
     * 设置用户ID
     *
     * @param user 要设置的用户
     */
    public void setUser(User user) {
        this.user = user;
    }

    /**
     * 获取用户登录密码
     *
     * @return 登录密码
     */
    public String getPwd() {
        return pwd;
    }

    /**
     * 设置登录密码
     *
     * @param pwd
     */
    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    /**
     * 获取交易密码
     *
     * @return 交易密码
     */
    public String getPayPwd() {
        return payPwd;
    }

    /**
     * 设置交易密码
     *
     * @param payPwd
     */
    public void setPayPwd(String payPwd) {
        this.payPwd = payPwd;
    }

    /**
     * 获取用户注册时间
     *
     * @return 用户注册时间
     */
    public Date getAddTime() {
        return addTime;
    }

    /**
     * 设置用户注册时间
     *
     * @param addTime
     */
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    /**
     * 获取删除状态
     *
     * @return 删除状态
     */
    public int getIsDelete() {
        return isDelete;
    }

    /**
     * 设置删除状态
     *
     * @param isDelete
     */
    public void setIsDelete(int isDelete) {
        this.isDelete = isDelete;
    }
}